package com.itheima.tliaswebmanagement.controller;


import com.itheima.tliaswebmanagement.pojo.CountDateOption;
import com.itheima.tliaswebmanagement.pojo.DegreeDataOption;
import com.itheima.tliaswebmanagement.pojo.JobDataOption;
import com.itheima.tliaswebmanagement.pojo.Result;
import com.itheima.tliaswebmanagement.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;

    @GetMapping("/empJobData")
    public Result empJobData() {
        log.info("员工岗位数据统计");
        JobDataOption jobDataOption = reportService.getEmpJobData();
        return Result.success(jobDataOption);
    }

    @GetMapping("/empGenderData")
    public Result empGenderData() {
        List<Map<String, Object>> genderList = reportService.getEmpGenderData();
        return Result.success(genderList);
    }

    @GetMapping("/studentCountData")
    public Result studentCountData() {
        CountDateOption countDateOption = reportService.getStudentCountData();
        return Result.success(countDateOption);
    }

    @GetMapping("/studentDegreeData")
    public Result studentDegreeData() {
        DegreeDataOption degreeDataOption = reportService.getStudentDegreeData();
        return Result.success(degreeDataOption);
    }

}
